﻿using System;
using UnityEngine;
using UnityEngine.UI;

public class MyUI : MonoBehaviour
{
    private Text txtLevel;
    private Button btnAddCount;

    public Action actionBtnCount;
    void Start()
    {
        txtLevel = transform.Find("TxtCount").gameObject.GetComponent<Text>();
        btnAddCount = transform.Find("BtnCount").gameObject.GetComponent<Button>();
        btnAddCount.onClick.AddListener(OnClickAddCount);
    }
    private void OnClickAddCount()
    {
        actionBtnCount?.Invoke();
    }
    public void SetTxtCount(MyData myData)
    {
        txtLevel.text = myData.Count.ToString();
    }
}
